// 2维向量

#ifndef ALICE_PHYSICS_VECTOR2D_H_
#define ALICE_PHYSICS_VECTOR2D_H_

#include <iostream>

namespace alice {

class Vector2D {
  public:
    double X, Y;

  public:
    Vector2D(double x=0, double y=0):X(x), Y(y) {}

  public:
    Vector2D operator+(const Vector2D& v2) const {
      return Vector2D(X + v2.X, Y + v2.Y);
    }

    Vector2D operator-(const Vector2D& v2) const {
      return Vector2D(X - v2.X, Y - v2.Y);
    }

    Vector2D operator*(const double scalar) const {
      return Vector2D(X * scalar, Y * scalar);
    }

    void Log(std::string msg = "") {
      std::cout << msg << "(X, Y) = (" << X << ", " << Y << ")\n"; 
    }
};

}

#endif // ALICE_PHYSICS_VECTOR2D_H_